{% extends 'layout.html' %}
{% block css %}
  <style>

        ul {
            list-style-type: none;
            padding: 0;
        }

        ul li {
            float: left;
            padding: 10px;
            padding-left: 0;
            width: 80px;
        }

        ul li i {
            font-size: 18px;
            margin-left: 5px;
            color: #6d6565;
        }


  </style>
{% endblock %}


{% block content %}
   <div>
      {{ form_obj.non_field_errors.0 }}  <!-- 非字段错误的报错信息 -->
    </div>

  <form class="form-horizontal" style="margin-top: 60px;" novalidate method="post">
  {% csrf_token %}

  {% for field in form_obj %}

      <div class="form-group {% if field.errors %}has-error{% endif %}">

        <label for="{{ field.id_for_label }}" class="col-sm-2 control-label">{{ field.label }}</label>
        <div class="col-sm-8">
          {{ field }}
        </div>
        <div class="col-sm-2" style="color: red;font-size: 12px;">
          {{ field.errors.0 }}
        </div>
      </div>

  {% endfor %}


  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">提交</button>
    </div>
  </div>
</form>




{% endblock %}








